package com.neusoft.databus.core.service;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import com.neusoft.bizcore.web.support.Searchable;
import com.neusoft.databus.common.dto.MetricDTO;

/**
 * @author naxiang
 */
public interface MetricService {
    MetricDTO findById(Long id);

    MetricDTO findByCode(String code);

    MetricDTO findByResourceAndCode(String resourceCode, String code);

    List<MetricDTO> findAll();

    Page<MetricDTO> search(Pageable pageable, Searchable searchable);

    List<MetricDTO> search(Searchable searchable);

    MetricDTO create(MetricDTO dto);

    MetricDTO update(String code, MetricDTO dto);

    void deleteById(Long id);

    void deleteByCode(String code);

    void deleteByIdIn(List<Long> ids);

    void importTpl(MultipartFile excel);

    SXSSFWorkbook getTpl();

    void export(final Searchable searchable, final Pageable pageable, final HttpServletResponse response);
}
